class GeAnBeanDetail {
  GeAnDetailInfo? bean;
  GeAnCaptionInfo? caption;

  GeAnBeanDetail({
    this.bean,
    this.caption,
  });

  GeAnBeanDetail.fromJson(Map data) {
    bean = GeAnDetailInfo.fromJson(data['bean']);
    caption = GeAnCaptionInfo.fromJson(data['caption']);
  }
}

class GeAnDetailInfo {
  int? id;
  int? status;
  int? age;
  String? elderName;
  String? bedNo;
  String? reason;
  String? createdBy;
  String? createdDate;

  List<RecordInfo>? records;
  List<UserInfo>? executeHumanList;
  List<AttachFilesInfo>? attachFiles;

  GeAnDetailInfo({
    this.bedNo,
    this.id,
    this.status,
    this.reason,
    this.createdBy,
    this.createdDate,
    this.elderName,
    this.age,
    this.records,
    this.executeHumanList,
    this.attachFiles,
  });

  factory GeAnDetailInfo.fromJson(Map<String, dynamic> json) {
    final originList = json['records'] as List?;
    List<RecordInfo> protocolList =
        (originList??[]).map((value) => RecordInfo.fromJson(value)).toList();

    final originList1 = json['executeHumanList'] as List?;
    List<UserInfo> protocolList1 =
        (originList1??[]).map((value) => UserInfo.fromJson(value)).toList();
    final originList2 = json['attachFiles'] as List?;
    List<AttachFilesInfo> protocolList2 =
        (originList2??[]).map((value) => AttachFilesInfo.fromJson(value)).toList();

    return GeAnDetailInfo(
      records: protocolList,
      executeHumanList: protocolList1,
      attachFiles: protocolList2,
      bedNo: json['bedNo'],
      reason: json['reason'],
      createdBy: json['createdBy'],
      createdDate: json['createdDate'],
      elderName: json['elderName'],
      id: json['id'],
      status: json['status'],
      age: json['age'],
    );
  }
}

class RecordInfo {
  String? createdDate;
  String? remark;
  String? operator;

  RecordInfo({
    this.operator,
    this.createdDate,
    this.remark,
  });

  RecordInfo.fromJson(Map data) {
    remark = data['remark'];
    operator = data['operator'];
    createdDate = data['createdDate'];
  }
}

class GroupsInfo {
  List<UserInfo>? users;

  GroupsInfo({
    this.users,
  });

  factory GroupsInfo.fromJson(Map<String, dynamic> json) {
    final originList = json['users'] as List?;
    List<UserInfo> protocolList =
        (originList??[]).map((value) => UserInfo.fromJson(value)).toList();
    return GroupsInfo(users: protocolList);
  }
}

class UserInfo {
  String? name;
  int? userId;

  UserInfo({
    this.name,
    this.userId,
  });

  UserInfo.fromJson(Map data) {
    name = data['name'];
    userId = data['userId'];
  }
}

class AttachFilesInfo {
  String? path;
  int? id;

  AttachFilesInfo({
    this.path,
    this.id,
  });

  AttachFilesInfo.fromJson(Map data) {
    path = data['path'];
    id = data['id'];
  }
}

class GeAnCaptionInfo {
  String? customerElderId;
  String? createdBy;

  GeAnCaptionInfo({
    this.customerElderId,
    this.createdBy,
  });

  GeAnCaptionInfo.fromJson(Map data) {
    customerElderId = data['customerElderId'];
    createdBy = data['createdBy'];
  }
}
